package fr.vahren.sriksal.dao.bean;

import java.util.Collection;

import fr.vahren.sriksal.controller.impl.MapController;

public class MapDaoBean {
	
	private long mapId;
	
	private long userId;
	
	/**
	 * @return the userId
	 */
	public long getUserId() {
		return userId;
	}

	/**
	 * @param userId the userId to set
	 */
	public void setUserId(long userId) {
		this.userId = userId;
	}

	private TileDaoBean[][] map;

	/**
	 * @return the mapId
	 */
	public long getMapId() {
		return mapId;
	}

	/**
	 * @param mapId the mapId to set
	 */
	public void setMapId(long mapId) {
		this.mapId = mapId;
	}

	/**
	 * @return the map
	 */
	public TileDaoBean[][] getMap() {
		return map;
	}

	/**
	 * @param map the map to set
	 */
	public void setMap(TileDaoBean[][] map) {
		this.map = map;
	}

	public void fillMap(Collection<TileDaoBean> tileDaoBeans) {
		map = new TileDaoBean[MapController.MAP_W][MapController.MAP_H];
		for(TileDaoBean tile:tileDaoBeans){
			map[tile.getX()][tile.getY()] = tile;
		}
	}

}
